﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;

namespace MyMessenger.Core
{
    [ActiveRecord]
    public class Messege
    {
        private int id;
        private string text;
        private User fromUser;
        private User toUser;
        private DateTime time;

        [PrimaryKey]
        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        [Property]
        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        [BelongsTo(NotNull=true)]
        public User FromUser
        {
            get { return fromUser; }
            set { fromUser = value; }
        }

        [BelongsTo]
        public User ToUser
        {
            get { return toUser; }
            set { toUser = value; }
        }

        [Property]
        public DateTime Time
        {
            get { return time; }
            set { time = value; }
        }

    }
}
